package io.geekidea.boot.warehousentry.services.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.warehousentry.dto.StatisticsDto;
import io.geekidea.boot.warehousentry.dto.WarehousentryExcel;
import io.geekidea.boot.warehousentry.query.entity.Warehousentry;
import io.geekidea.boot.warehousentry.mapper.Warehouseentrymapper;
import io.geekidea.boot.warehousentry.query.WarehousentryQuery;
import io.geekidea.boot.warehousentry.services.WarehousentryService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class WarehousentryServiceImpl extends ServiceImpl<Warehouseentrymapper, Warehousentry> implements WarehousentryService {

    @Resource
    Warehouseentrymapper warehouseentrymapper;

    @Override
    public Page<Warehousentry> warehousentryPage(Page<Warehousentry> page, WarehousentryQuery warehousentryQuery) {
        return warehouseentrymapper.getWarehousentryPageList(page,warehousentryQuery);
    }

    @Override
    public List<WarehousentryExcel> getDownloadList(WarehousentryQuery warehousentryQuery){
        return warehouseentrymapper.getDownloadList(warehousentryQuery);
    }

    @Override
    public int getSingularCount(WarehousentryQuery warehousentryQuery) {
        return warehouseentrymapper.getSingularCount(warehousentryQuery);
    }

    @Override
    public List<StatisticsDto> getWeekCount(WarehousentryQuery warehousentryQuery) {
        return warehouseentrymapper.getWeekCount(warehousentryQuery);
    }
}
